<!DOCTYPE html>
<html lang="en" >
<head>
  <div th:insert="commons.html"></div>
  <meta charset="UTF-8">
  <title>Title</title>
  <script type="text/javascript">
   /* function login(){
      $.ajax({
        url:"/person/login",//请求需要访问的地址
        type:"post",//请求方式 默认为get 可以设置为post
        dataType:"json",//返回值类型 html,json,text,xml
        data: $("#loginForm").serialize(),//前台到后台的参数，没有数据时可以不写
        async : true,//true代表异步刷新，false代表同步刷新
        success : function (result){//成功回调函数
          if(result == 1){
            toastr.warning("该账号未注册");
          }else if (result == 3){
            toastr.error("用户名或者密码错误")

          }else {
             location.href="/menu/toShow";
          }
        },
        error : function (result){//错误回调函数
          alert("网络异常，请刷新");
        }
      })
    }*/

  </script>
</head>
<body>

<div class="container-fluid" align="center">
  <div class="panel panel-primary" style="width:300px;">
    <div class="panel-heading">
      <h1>登录</h1>
    </div>
    <div class="panel-body">
      <span style="color: #ff192f;" th:text="${mesg}"></span>
      <form action="/person/login" method="post">
        <div class="form-group">
          <label for="name">账号</label>
          <input type="text" class="form-control" name="pname" id="name"
                 placeholder="请输入账号">
          <div id="tips"></div>
        </div>
        <div class="form-group">
          <label for="pwd">密码</label>
          <input type="password" class="form-control" name="pwd" id="pwd">
        </div>
        <input type="submit" class="btn btn-success btn-lg" value="登录"/>
      </form>
    </div>
    <div class="panel-footer">
      <a href="#">忘记密码？</a>
    </div>
  </div>
</div>
</body>
</html>
